package com.zr.domain.sp.controller;


import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RedisController {
    final
    RedisTemplate<String,String> redisTemplate;

    public RedisController(RedisTemplate<String, String> redisTemplate) {
        this.redisTemplate = redisTemplate;
    }


    @RequestMapping(value = "redis/test")

    public String getString(){
        return (String) redisTemplate.opsForValue().get("test");
    }
}
